Generation Gap (pattern)
   HOME

TheInfoList



OR:

Generation gap is a
software design pattern In software engineering, a software design pattern is a general, reusable solution to a commonly occurring problem within a given context in software design. It is not a finished design that can be transformed directly into source or machine code ...
documented by
John Vlissides John Matthew Vlissides (August 2, 1961 – November 24, 2005) was a software engineer known mainly as one of the four authors (referred to as the Gang of Four) of the book '' Design Patterns: Elements of Reusable Object-Oriented Software''. Vliss ...
that treats automatically generated code differently than code that was written by a
developer Developer may refer to: Computers * Software developer, a person or organization who develop programs/applications * Video game developer, a person or business involved in video game development, the process of designing and creating games * Web d ...
. Modifications should not be made to generated code, as they would be overwritten if the code generation process was ever re-run, such as during
recompilation A binary recompiler is a compiler that takes executable binary files as input, analyzes their structure, applies transformations and optimizations, and outputs new optimized executable binaries. The foundation to the concepts of binary recompila ...
. Vlissides proposed creating a subclass of the generated code which contains the desired modification. This might be considered an example of the
template method pattern In object-oriented programming, the template method is one of the behavioral design patterns identified by Gamma et al. in the book ''Design Patterns''. The template method is a method in a superclass, usually an abstract superclass, and defines ...
.


Modern languages

Modern byte-code language like Java were in their early stages when Vlissides developed his ideas. In a language like Java or C#, this pattern may be followed by generating an interface, which is a completely abstract class. The developer would then hand-modify a concrete implementation of the generated interface.


References

Software design patterns {{comp-sci-stub